home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.9 KB | 145 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ShpTrakr.h
- // Release Version: $ ODF 1 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SHPTRAKR_H
- #define SHPTRAKR_H
-
- // ----- Part Layer -----
-
- #ifndef FWTRACKR_H
- #include "FWTrackr.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWINK_H
- #include "FWInk.h"
- #endif
-
- #ifndef FWSTYLE_H
- #include "FWStyle.h"
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class CBaseShape;
- class FW_CScroller;
-
- //========================================================================================
- // class CShapeTracker
- //========================================================================================
-
- class CShapeTracker : public FW_CTracker
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CShapeTracker(Environment* ev,
- FW_CView* view,
- ODFacet* facet,
- CBaseShape* theShape,
- FW_Boolean gridOn);
- virtual ~CShapeTracker();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- protected:
- void ForceToGrid(Environment* ev, FW_CPoint& point);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CBaseShape* fShape;
- FW_Boolean fErase;
- FW_Boolean fGridOn;
- FW_CScroller* fScroller;
- };
-
- //========================================================================================
- // class CResizeTracker
- //========================================================================================
-
- class CResizeTracker : public FW_CTracker
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CResizeTracker(Environment* ev,
- FW_CView* view, ODFacet* facet,
- CBaseShape* theShape, short whichHandle,
- const FW_CInk& resizeInk, const FW_CStyle& resizeStyle,
- FW_Boolean gridOn);
- virtual ~CResizeTracker();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void GetLastLocation(FW_CPoint& lastLocation)
- {lastLocation = fLastLocation;}
-
- private:
- void ForceToGrid(Environment* ev, FW_CPoint& point);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CBaseShape* fShape;
- short fWhichHandle;
- FW_Boolean fErase;
- FW_CInk fResizeInk;
- FW_CStyle fResizeStyle;
- FW_CPoint fDelta;
- FW_Boolean fGridOn;
- FW_CPoint fLastLocation;
- FW_CScroller* fScroller;
- };
-
- #endif